	*===========================*
	* Table 16 - teacher FE results
	*===========================*


			local r=1
			eststo clear
		estimates clear
foreach outcomevar of varlist  read_std math_std {
		
		preserve
			
		if "`outcomevar'" == "math_std" {
			keep if subject == "Math"
			local outcomename "m"
			}
		else if "`outcomevar'" == "read_std" {
			keep if subject == "ELA"
			local outcomename "r"
			}
		
		quiet{
				
			
			eststo model`r': areg `outcomevar' $nothreatvars exp_capped exp_capped_squared $sdemovars $gradevar $prevvars i.year i.sch_id $yeardosevar, absorb(id) vce(cluster _id_year)
			global my_cmd `e(cmdline)'
			global my_num `r'
			*do "$code_dir\Randomization Inference.do"
			local r=`r'+1
			
			
			eststo model`r': areg `outcomevar' $nothreatvars i.exp_capped $sdemovars $gradevar $prevvars i.year i.sch_id $yeardosevar, absorb(id) vce(cluster _id_year)
			global my_cmd `e(cmdline)'
			global my_num `r'
			*do "$code_dir\Randomization Inference.do"
			local r=`r'+1
			
			
			eststo model`r': areg `outcomevar' $nothreatvars experience experience_squared $sdemovars $gradevar $prevvars i.year i.sch_id $yeardosevar, absorb(id) vce(cluster _id_year)
			global my_cmd `e(cmdline)'
			global my_num `r'
			*do "$code_dir\Randomization Inference.do"
			local r=`r'+1
			
			
			eststo model`r': areg `outcomevar' $nothreatvars i.experience $sdemovars $gradevar $prevvars i.year i.sch_id $yeardosevar, absorb(id) vce(cluster _id_year)
			global my_cmd `e(cmdline)'
			global my_num `r'
			*do "$code_dir\Randomization Inference.do"
			local r=`r'+1


			local namevar "linear"
			local keepvars $nothreatvars
			}
		
		
		restore
		}

		estfe model*, labels(id "Teacher FE")
		
		
		*"Evaluation Feedback Time = postconf_*"
		*   "Threat Intensity = haz_*"
		*" 
		if "$do_ri" == "YES" {
			esttab model* using "$output_dir\Tables\_Table_A01_`namevar'_both.tex", ///
				indicate("Previous Student Scores = math_std_t" ///
						"Teacher Experience=*xp*" "Student Demographics = *.male" , labels("X" " ")) ///
					cells("b(${stars} fmt(%5.4fc) label(!))" "se(par fmt(%5.4fc) label(!))" "LB(fmt(%5.4fc) par(zz ) label(!)) & UB(fmt(%5.4fc) par(qq ww) label(!))") ///
					keep(`keepvars', relax) substitute(zz "[" qq " " ww "]" ! " " / "") starlevels(\$^+\$ 0.10 * 0.05 ** 0.01 *** 0.001) gaps nonotes ///
					mgroups(Reading Math, pattern(1 0 0 0 1 0 0 0)                   ///
						prefix(\multicolumn{@span}{c}{) suffix(})   ///
						span erepeat(\cmidrule(lr){@span}))         ///
					label nodepvars eqlabels(none) nomtitles nolegend replace 

			* return stored estimates to their previous state
			estfe model*, restore
		}
		else {
			esttab model* using "$output_dir\Tables\_Table_A01_`namevar'_both_pval.tex", ///
				indicate("Previous Student Scores = math_std_t" ///
						"Teacher Experience=*xp*" "Student Demographics = *.male" , labels("X" " ")) ///
					cells("b(${stars} fmt(%5.4fc) label(!))" "se(par fmt(%5.4fc) label(!))" "p(par(zz ww) fmt(%5.4fc)  label(!))") ///
					keep(`keepvars', relax) substitute(zz "[" qq " " ww "]" ! " " / "") starlevels(\$^+\$ 0.10 * 0.05 ** 0.01 *** 0.001) gaps nonotes ///
					mgroups(Reading Math, pattern(1 0 0 0 1 0 0 0)                   ///
						prefix(\multicolumn{@span}{c}{) suffix(})   ///
						span erepeat(\cmidrule(lr){@span}))         ///
					label nodepvars eqlabels(none) nomtitles nolegend replace 

			* return stored estimates to their previous state
			estfe model*, restore
		}